﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Web.SystemConfig.Services;
using System.Data;
using Web.SystemConfig.DataAccess;
using DreamBuilder.Common;

namespace Web.SystemConfig.Business
{
    public class BUSUserRoleFunction : BusinessBase, IUserRoleFunction
    {
        DALUserRoleFunction dal;

        public BUSUserRoleFunction()
        {
            dal = new DALUserRoleFunction();
        }

        public DataTable SelectFunctionsTableByUserID(string UserID)
        {
            return dal.SelectFunctionsTableByUserID(UserID);
        }

        public string GetCreateByField(string menuID)
        {
            DataTable dt = dal.GetCreateByField(menuID);
            string createByField = string.Empty;
            if (dt!=null&&dt.Rows.Count>0)
            {
                createByField = dt.Rows[0]["Create_Columm"].ToString();
            }
            return createByField;
        }

        public string GetEncryptColumnFields(string menuID)
        {
            DataTable dt = dal.GetEncryptColumnFields(menuID);
            string encryptColumnFields = string.Empty;
            if (dt != null && dt.Rows.Count > 0)
            {
                encryptColumnFields = dt.Rows[0]["Filter_Columm_Str"].ToString();
            }
            return encryptColumnFields;
        }

    }
}